//@PCSTART@//
package com.bluetane.pc;
//@PCEND@//
/*//@ANDROIDSTART@//
package com.bluetane.android;
//@ANDROIDEND@//*/

import java.util.Iterator;
import java.util.Vector;


public class BluetaneEventSource
{
    private Vector<BluetaneListener> listenerList = new Vector<BluetaneListener>();
    public synchronized void addEventListener(BluetaneListener listener)
    {
        listenerList.add(listener);
    }
    public synchronized void removeEventListener(BluetaneListener listener)
    {
        listenerList.remove(listener);
    }

    protected synchronized void fireEvent(BluetaneEvent event)
    {
        Iterator<BluetaneListener> i = listenerList.iterator();
        while(i.hasNext())
        {
            i.next().handleBluetaneEvent(event);
        }
    }
}
